##################################
# 
# Authors: ZhangXuelian
# 	
# 
# Changes:
# 	
#	
##################################

ifeq ($(PLATFORM),Android)
	CROSS_COMPILE=/work/work/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-
	SYSROOT=/work/work/android-ndk-r9/platforms/android-9/arch-arm/usr
    CC=$(CROSS_COMPILE)gcc-4.6
	CXX=$(CROSS_COMPILE)g++
	AR=$(CROSS_COMPILE)ar
	SYSLIB=$(SYSROOT)/lib
	SYSINCLUDE=$(SYSROOT)/include
    RANLIB= $(CROSS_COoMPILE)ranlib
	STRIP=$(CROSS_COMPILE)strip
    INC = -I. -I$(HOME)/include -I$(SDKDIR)/include -I$(SDKDIR)/lib
	CFLAGS = $(INC) -fomit-frame-pointer -pipe -DLINUX_KERNEL_3_10_14 -Dlinux -DDEBUG -D__linux__ -Dunix -DEMBED -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -finline-functions -msoft-float --sysroot=/work/work/android-ndk-r9/platforms/android-9/arch-arm -marm -o3 -Wl,--no-undefined -DLINUX -DUNIX -D__linux -DANDROID -I. -I../include/
	MYLIB = ../lib
	LDFLAGS = -L. -L$(MYLIB)
endif

ifeq ($(PLATFORM),iOS)
	CROSS_COMPILE=#
	CC=$(CROSS_COMPILE)gcc
	CXX=$(CROSS_COMPILE)g++
	AR=$(CROSS_COMPILE)ar
	RANLIB= $(CROSS_COoMPILE)ranlib
	STRIP=$(CROSS_COMPILE)strip
    SDKDIR=/work/openwrt/trunk/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2
	STAGING_DIR=/work/openwrt/trunk/staging_dir
    export STAGING_DIR=/work/openwrt/trunk/staging_dir
    INC = -I. -I$(HOME)/include -I$(SDKDIR)/include -I$(SDKDIR)/lib
	CFLAGS = $(INC) -fomit-frame-pointer -pipe -DLINUX_KERNEL_3_10_14 -Dlinux -DDEBUG -D__linux__ -Dunix -DEMBED -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -finline-functions -msoft-float 
	MYLIB = ../lib
	LDFLAGS = -L. -L$(MYLIB)
endif

ifeq ($(PLATFORM),Linux)
	CC=gcc
	CXX=g++
	AR=ar
	STRIP=strip
	CFLAGS = $(INC) -fomit-frame-pointer -pipe -DLINUX_KERNEL_3_10_14 -Dlinux -DDEBUG -D__linux__ -Dunix -DEMBED -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -finline-functions -msoft-float 
	MYLIB = ../lib
	LDFLAGS = -L. -L$(MYLIB)
endif

ifeq ($(RELEASE),y)
	CFLAGS += -O3
else
	CFLAGS += -DDEBUG
endif

ifneq ($(NOSSL),y)
CFLAGS += -DSUPPORT_SSL
endif




